package com.atlbb.service.Impl;

import com.atlbb.dao.GoodsDao;
import com.atlbb.mybatis.entity.Goods;
import com.atlbb.service.GoodsService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @author LiangQingBin
 * @version 1.00
 * @ClassName GoodsServiceImpl
 * @Description TODO
 * @time 2021/12/5 15:39
 */
@Service
public class GoodsServiceImpl implements GoodsService {
    @Autowired
    GoodsDao goodsDao;
    
    @Override
    public List<Goods> findAllGoods() {
        return goodsDao.findAllGoods();
    }
    
    @Override
    public void saveOneGoods(Goods goods) {
        goodsDao.saveOneGoods(goods);
    }
    
    @Override
    public void deleteOneGoodsById(Long g_id) {
        goodsDao.deleteOneGoodsById(g_id);
    }
    
    @Override
    public void updateOneGoods(Goods goods) {
        goodsDao.updateOneGoods(goods);
    }
    
    @Override
    public void buyGoods(Long id, Long g_count) {
        goodsDao.buyGoods(id,g_count);
    }
}
